/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utils;

import java.util.Map;
import javax.faces.context.FacesContext;

/**
 *
 * @author Misja
 */
public class JSFSessionHandler {
    
    public static void putObjectInSession(String key, Object object){
        getSessionMap().put(key, object);   
    }
    
    public static Object getObjectFromSession(String key){
       return getSessionMap().get(key);
    }
    
    public static Map<String, Object> getSessionMap(){
        return FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
    }
    
     public static void clearSession(){
       FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
     }
}
